package com.hanfeng.client.view;

import java.io.File;
import java.util.List;

import com.hanfeng.client.adapter.MusicListAdapter;
import com.hanfeng.client.entity.Music;
import com.hanfeng.client.entity.MusicList;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ListView;
import android.widget.Toast;

/**
 * 音乐列表
 * @author hanfeng
 * @data 2012-8-30 下午2:26:57
 */
public class MusicListActivity extends SuperActivity{
	//声明ListView控件
	private ListView listView;
	//音乐列表适配器
	private MusicListAdapter adapter;
	//声明File
	private File dir;
	private View loadingview;
	private Handler handler = new Handler(){
		public void handleMessage(Message msg){
			switch (msg.what) {
			case 0:
				Toast.makeText(MusicListActivity.this, "xml解析完成", Toast.LENGTH_SHORT).show();
				loadingview.setVisibility(View.GONE);				
				break;
			case 1:
				Music music = (Music)msg.obj;
				adapter.addMusic(music);
				break;
			default:
				loadingview.setVisibility(View.GONE);
				break;
			}
		}
	};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//设置音乐列表布局
		setContentView(R.layout.music_list);
	
		
//		listView = (ListView)findViewById(R.id.allMusicList);
//		List<Music> listMusic = MusicList.getMusicDate(getApplicationContext());
			
	}

}
